package action;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.BoardBean;
import mgr.DBMgr;

public class BoardDetailAction implements BoardAction {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		String board_num = request.getParameter("num");
		DBMgr mgr = new DBMgr();
		DBMgr mgr1 = new DBMgr();
		mgr1.readcount(board_num);
		BoardBean bean = mgr.getArticle(board_num);
		request.setAttribute("bean", bean);
		RequestDispatcher dis = 
				request.getRequestDispatcher("./board/qna_board_view.jsp");
		try {
			dis.forward(request, response);
		} catch (ServletException | IOException e) {
			e.printStackTrace();
		}//try~catch
	}//exe
}//class
